<template>
  <div>
    <h4>Item组件</h4>
    <strong>{{ $route.params.title }}</strong>
    <p v-if="result === '001'">CF简介</p>
    <p v-if="result === '002'">DNF简介</p>
    <p v-if="result === '003'">LOL简介</p>
  </div>
</template>

<script>
export default {
  name: "Item",
  data() {
    return {
      result: "",
    };
  },
  mounted() {
    console.log(this.$route.params.id);
  },
  watch: {
    // 监听$route的变化
    $route() {
      console.log(this.$route.params.id);
      this.result = this.$route.params.id;
    },
  },
};
</script>

<style></style>
